package vaani.internal.application;

/**
 *
 * @author sourcemorph
 */
public class Result implements Comparable {

    String dotDesktopFile;
    String name;
    double searchScore;

    public Result(String dotDesktopFile, String name, double searchScore) {
        this.dotDesktopFile = dotDesktopFile;
        this.name= name;
        this.searchScore = searchScore;
    }

    public String getDotDesktopFile() {
        return dotDesktopFile;
    }

    public String getName() {
        return name;
    }

    public double getScore() {
        return searchScore;
    }

    public int compareTo(Object anotherResult) throws ClassCastException {
        if (!(anotherResult instanceof Result ))
            throw new ClassCastException("A Result object expected.");
        return (int) (getScore() - ((Result) anotherResult).getScore());
    }

}
